<%--
  Created by IntelliJ IDEA.
  User: teacher
  Date: 2023/10/24
  Time: 15:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>访问次数</title>
</head>
<body>
<h1>当问访问页面的次数为:<%=session.getAttribute("count")%></h1>
<!--
    response.encodeURL(url):URL重写,适用于禁用cookie的场景
        会将url进行二次处理,在地址栏生成一个新的jsessionid传输
    response.encodeRedirectURL(url):URL重写
-->
<a href="<%=response.encodeURL(request.getContextPath()+"/count")%>">URL重写方式一</a>
<a href="<%=response.encodeRedirectURL(request.getContextPath()+"/count")%>">URL重写方式二</a>
</body>
</html>
